verification: deterministic host-vitest fixture bootstrap with clear diagnostics#813
Open
brandonpayton wants to merge 1 commit into
Conversation
…diagnostics The host vitest full gate needs host/wasm/rootfs.vfs and a wasm64 hello64.wasm fixture that vitest's globalSetup never builds. In a fresh Homebrew package worktree the bootstrap failed ambiguously: outside the dev shell it died with an opaque "tool 'clang' not found" Rust-linker wall, and inside it a release-cache cache_key drift silently fell through to a source build behind an easy-to-miss stderr warning, so a cache miss looked the same as a real failure. Add scripts/prepare-vitest-fixtures.sh: one documented dev-shell command that preflights tools (naming a MISSING TOOL distinctly from a release-cache miss), classifies each rootfs input as a release-cache HIT vs MISS via `xtask build-deps resolve --fetch-only`, idempotently builds the wasm32/wasm64 sysroots + kernel + wasm64 hello64 + host/wasm/rootfs.vfs, and writes passed/failed/skipped outcome-list artifacts. --classify-only gives a fast "is my environment ready and what will source-build?" pre-check. Document the sequence and expected fixture paths in docs/agent-guidance/validation.md, and add a non-fatal SDK-toolchain-awareness warning to scripts/fetch-binaries.sh so its own failures distinguish a missing tool from a cache miss. Verified in dev shell: fixtures build (bootstrap passed=28, failed=0); the fixture-dependent host vitest tests (getpwent, node-host-mounts, wasm64) now run instead of skipping — 3 files / 11 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Make the host vitest full gate (
cd host && npx vitest run) reproducible in afresh (e.g. Homebrew package) worktree by giving it a deterministic,
self-diagnosing fixture bootstrap.
Problem
The gate needs two artifacts vitest's
globalSetupnever builds:host/wasm/rootfs.vfs— getpwent + node-host-mounts testslocal-binaries/programs/wasm64/hello64.wasm— wasm64 testsTests
skipIf(...)themselves when these are missing, so a run can be greenwhile silently skipping rootfs/wasm64 coverage. Preparing them via
fetch-binaries/build-rootfsfailed ambiguously:scripts/dev-shell.sh: an opaquetool 'clang' not foundRustlinker wall (the SDK cross-toolchain and even the host Rust linker are
dev-shell-only).
cache_keydrift silently fellthrough to a source build behind an easy-to-miss stderr
warning:, so acache miss looked identical to a real failure.
Change
scripts/prepare-vitest-fixtures.sh(new) — one documented dev-shellcommand that:
release-cache miss (exit 3);
xtask build-deps resolve --fetch-only, so forced source builds are namedand expected rather than a silent fallback;
hello64,and
host/wasm/rootfs.vfs;--classify-onlygives a fast "is my environment ready and what willsource-build?" pre-check.
docs/agent-guidance/validation.md— new "Preparing host vitestfixtures" section (command + expected fixture paths).
scripts/fetch-binaries.sh— non-fatal SDK-toolchain-awareness warningso the named script's own failures distinguish a missing tool from a cache
miss (stderr-only; no control-flow or exit-code change).
Verification (in dev shell)
passed=28 failed=0 skipped=1.getpwent,node-host-mounts,wasm64):3 files / 11 tests pass, 0 skipped (previously skipped without fixtures).
Scope / limitations
npx vitest run(which additionally needs rootnpm ci; out of this bead'sscope).
published HIT here, and forcing a miss would mean clearing the resolver
cache shared with another active porter's live builds. The MISS branch is a
trivial symmetric path whose trigger (non-zero
--fetch-onlyexit) isconfirmed by the resolver code.
host/vitest.config.tsusestest.poolOptions,removed in the now-installed Vitest 4 (deprecation warning only, run still
passes).
Bead: kd-eo3w (initiative:homebrew-all; follow-up from kd-p3hr).
🤖 Generated with Claude Code